const state = {
  orderlist: [
    {
      order_id: 0,
      order_price: 13999,
      order_create_time: "2021-11-21",
      order_address: {
        id: "1",
        name: "张三",
        tel: "13000000000",
        address: "浙江省杭州市西湖区文三路 138 号东方通信大厦 7 楼 501 室",
      },
      goods_list: [
        {
          goods_name:
            "海信(Hisense)LED55MU9600X3DUC 55英寸 4K超高清量子点电视 ULED画质 VIDAA系统",
          goods_price: 13999,
          goods_introduce:
            '<div class="lazyimg"><div moduleid="R0503002_2" modulename="关联推荐"><p><a href="https://shop.suning.com/30000011/index.html" target="_blank"><img data-src="https://image.suning.cn/uimg/sop/commodity/152418403963754690151350_x.jpg?from=mobile&amp;format=80q.webp" alt="" src="https://image.suning.cn/uimg/sop/commodity/152418403963754690151350_x.jpg?from=mobile&format=80q.webp" width="100%" height="auto"></a></p>\n<table style="width: 100%; height: auto;">\n<tbody>\n<tr>\n<td><a href="https://product.suning.com/0000000000/721034170.html" target="_blank"><img data-src="https://image.suning.cn/uimg/sop/commodity/674265889569958711135500_x.jpg?from=mobile&amp;format=80q.webp" alt="" src="https://image.suning.cn/uimg/sop/commodity/674265889569958711135500_x.jpg?from=mobile&format=80q.webp" width="100%" height="auto"></a></td>\n<td><a href="https://product.suning.com/0030000011/659973806.html" target="_blank"><img data-src="https://image.suning.cn/uimg/sop/commodity/580804888269630832171600_x.jpg?from=mobile&amp;format=80q.webp" alt="" src="https://image.suning.cn/uimg/sop/commodity/580804888269630832171600_x.jpg?from=mobile&format=80q.webp" width="100%" height="auto"></a></td>\n<td><a href="https://product.suning.com/0000000000/646332415.html" target="_blank"><img data-src="https://image.suning.cn/uimg/sop/commodity/164947314370596747459900_x.jpg?from=mobile&amp;format=80q.webp" alt="" src="https://image.suning.cn/uimg/sop/commodity/164947314370596747459900_x.jpg?from=mobile&format=80q.webp" width="100%" height="auto"></a></td>\n</tr>\n<tr>\n<td><a href="https://product.suning.com/0030000011/719579209.html" target="_blank"><img data-src="https://image.suning.cn/uimg/sop/commodity/109859084335308009815860_x.jpg?from=mobile&amp;format=80q.webp" alt="" src="https://image.suning.cn/uimg/sop/commodity/109859084335308009815860_x.jpg?from=mobile&format=80q.webp" width="100%" height="auto"></a></td>\n<td><a href="https://product.suning.com/0000000000/154158097.html" target="_blank"><img data-src="https://image.suning.cn/uimg/sop/commodity/139086270826280834777770_x.jpg?from=mobile&amp;format=80q.webp" alt="" src="https://image.suning.cn/uimg/sop/commodity/139086270826280834777770_x.jpg?from=mobile&format=80q.webp" width="100%" height="auto"></a></td>\n<td><a href="https://product.suning.com/0000000000/683246685.html" target="_blank"><img data-src="https://image.suning.cn/uimg/sop/commodity/212695348731710262086520_x.jpg?from=mobile&amp;format=80q.webp" alt="" src="https://image.suning.cn/uimg/sop/commodity/212695348731710262086520_x.jpg?from=mobile&format=80q.webp" width="100%" height="auto"></a></td>\n</tr>\n</tbody>\n</table></div><div moduleid="R0503002_3" modulename="商品详情"><p><img data-src="//image.suning.cn/uimg/sop/commodity/323128866134590684049660_x.jpg?from=mobile&amp;format=80q.webp" alt="" src="//image.suning.cn/uimg/sop/commodity/323128866134590684049660_x.jpg?from=mobile&format=80q.webp" width="100%" height="auto"></p></div><div moduleid="R0503002_6" modulename="安装说明"><table style="width: 100%; height: auto;">\n<tbody>\n<tr>\n<td><a href="https://sale.suning.com/shfw/cdaz/index.html#suning" target="_blank"><img data-src="https://sale.suning.com/shfw/cdazpic/images/all.jpg?from=mobile&amp;format=80q.webp" alt="" src="https://sale.suning.com/shfw/cdazpic/images/all.jpg?from=mobile&format=80q.webp" width="100%" height="auto"></a></td>\n</tr>\n</tbody>\n</table></div></div>',
          pics: [
            {
              pics_id: 180137,
              goods_id: 43986,
              pics_big:
                "http://image5.suning.cn/uimg/b2c/newcatentries/0000000000-000000000160455569_1_800x800.jpg",
              pics_mid:
                "http://image5.suning.cn/uimg/b2c/newcatentries/0000000000-000000000160455569_1_400x400.jpg",
              pics_sma:
                "http://image5.suning.cn/uimg/b2c/newcatentries/0000000000-000000000160455569_1_200x200.jpg",
              pics_big_url:
                "http://image5.suning.cn/uimg/b2c/newcatentries/0000000000-000000000160455569_1_800x800.jpg",
              pics_mid_url:
                "http://image5.suning.cn/uimg/b2c/newcatentries/0000000000-000000000160455569_1_400x400.jpg",
              pics_sma_url:
                "http://image5.suning.cn/uimg/b2c/newcatentries/0000000000-000000000160455569_1_200x200.jpg",
            },
            {
              pics_id: 180138,
              goods_id: 43986,
              pics_big:
                "http://image1.suning.cn/uimg/b2c/newcatentries/0000000000-000000000160455569_2_800x800.jpg",
              pics_mid:
                "http://image1.suning.cn/uimg/b2c/newcatentries/0000000000-000000000160455569_2_400x400.jpg",
              pics_sma:
                "http://image1.suning.cn/uimg/b2c/newcatentries/0000000000-000000000160455569_2_200x200.jpg",
              pics_big_url:
                "http://image1.suning.cn/uimg/b2c/newcatentries/0000000000-000000000160455569_2_800x800.jpg",
              pics_mid_url:
                "http://image1.suning.cn/uimg/b2c/newcatentries/0000000000-000000000160455569_2_400x400.jpg",
              pics_sma_url:
                "http://image1.suning.cn/uimg/b2c/newcatentries/0000000000-000000000160455569_2_200x200.jpg",
            },
            {
              pics_id: 180139,
              goods_id: 43986,
              pics_big:
                "http://image2.suning.cn/uimg/b2c/newcatentries/0000000000-000000000160455569_3_800x800.jpg",
              pics_mid:
                "http://image2.suning.cn/uimg/b2c/newcatentries/0000000000-000000000160455569_3_400x400.jpg",
              pics_sma:
                "http://image2.suning.cn/uimg/b2c/newcatentries/0000000000-000000000160455569_3_200x200.jpg",
              pics_big_url:
                "http://image2.suning.cn/uimg/b2c/newcatentries/0000000000-000000000160455569_3_800x800.jpg",
              pics_mid_url:
                "http://image2.suning.cn/uimg/b2c/newcatentries/0000000000-000000000160455569_3_400x400.jpg",
              pics_sma_url:
                "http://image2.suning.cn/uimg/b2c/newcatentries/0000000000-000000000160455569_3_200x200.jpg",
            },
            {
              pics_id: 180140,
              goods_id: 43986,
              pics_big:
                "http://image3.suning.cn/uimg/b2c/newcatentries/0000000000-000000000160455569_4_800x800.jpg",
              pics_mid:
                "http://image3.suning.cn/uimg/b2c/newcatentries/0000000000-000000000160455569_4_400x400.jpg",
              pics_sma:
                "http://image3.suning.cn/uimg/b2c/newcatentries/0000000000-000000000160455569_4_200x200.jpg",
              pics_big_url:
                "http://image3.suning.cn/uimg/b2c/newcatentries/0000000000-000000000160455569_4_800x800.jpg",
              pics_mid_url:
                "http://image3.suning.cn/uimg/b2c/newcatentries/0000000000-000000000160455569_4_400x400.jpg",
              pics_sma_url:
                "http://image3.suning.cn/uimg/b2c/newcatentries/0000000000-000000000160455569_4_200x200.jpg",
            },
            {
              pics_id: 180141,
              goods_id: 43986,
              pics_big:
                "http://image4.suning.cn/uimg/b2c/newcatentries/0000000000-000000000160455569_5_800x800.jpg",
              pics_mid:
                "http://image4.suning.cn/uimg/b2c/newcatentries/0000000000-000000000160455569_5_400x400.jpg",
              pics_sma:
                "http://image4.suning.cn/uimg/b2c/newcatentries/0000000000-000000000160455569_5_200x200.jpg",
              pics_big_url:
                "http://image4.suning.cn/uimg/b2c/newcatentries/0000000000-000000000160455569_5_800x800.jpg",
              pics_mid_url:
                "http://image4.suning.cn/uimg/b2c/newcatentries/0000000000-000000000160455569_5_400x400.jpg",
              pics_sma_url:
                "http://image4.suning.cn/uimg/b2c/newcatentries/0000000000-000000000160455569_5_200x200.jpg",
            },
          ],
          goods_state: 2,
          goods_id: 43986,
          goods_small_logo:
            "http://image5.suning.cn/uimg/b2c/newcatentries/0000000000-000000000160455569_1_400x400.jpg",
          num: 1,
          selected: true,
        },
      ],
    },
  ],
};

const getters = {
  getOrderlist(state) {
    return state.orderlist;
  },
  getLength(state) {
    return state.orderlist.length;
  },
};

const actions = {};
const mutations = {
  AddOrder(state, item) {
    state.orderlist.push(item);
  },
  clearOrder(state) {
    for (let i = 0; i < state.orderlist.length; i++) {
      state.orderlist.splice(i, 1);
      i = i - 1;
    }
  },
};

export default {
  namespaced: true,
  state,
  getters,
  actions,
  mutations,
};
